package response

type ResponseData[T any] struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data T      `json:"data"`
}

func SuccessData[T any](data T) *ResponseData[T] {
	return &ResponseData[T]{
		Code: 200,
		Msg:  "success",
		Data: data,
	}
}

func ErrorData[T any](code int, msg string) *ResponseData[T] {
	return &ResponseData[T]{
		Code: code,
		Msg:  msg,
	}
}
